#include<iostream>
#include<cmath>
using namespace std;

float x,y;
int peo;
float z;
double t = 0;

int main()
{
	int n;
	cin >> n;
	for(int i = 1;i <= n;i++)
	{
		cin >> x >> y >> peo;
		z = sqrt(x * x + y * y);
		t += z / 50 * 2 + peo + peo * 0.5; 
	 } 
	 cout << (int)ceil(t) << endl;
	return 0;
}
